home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Gekikoh Dennoh Club 5
/
Gekikoh Dennoh Club Vol. 5 (Japan).7z
/
Gekikoh Dennoh Club Vol. 5 (Japan) (Track 01).bin
/
internet
/
tcppack
/
tcppackb.lzh
/
src
/
libnetwork
/
dns.c
< prev
next >
Wrap
C/C++ Source or Header
|
1994-08-05
|
4KB
|
164 lines
/*
* dns.c
*
* Copyright (C) 1994 First Class Technology.
*/
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include"tcpipdrv.h"
#include"network.h"
_ti_func search_ti_entry (void);
/************************************************
* *
************************************************/
int
dns_add (long ipaddr)
{
_ti_func func = search_ti_entry ();
if (func)
return func (_TI_dns_add, (long *)ipaddr);
return -1;
}
/************************************************
* *
************************************************/
int
dns_drop (long ipaddr)
{
_ti_func func = search_ti_entry ();
if (func)
return func (_TI_dns_drop, (long *)ipaddr);
return -1;
}
/************************************************
* *
************************************************/
struct dns *
dns_get (void)
{
_ti_func func = search_ti_entry ();
if (func)
return (struct dns *)func (_TI_dns_get, NULL);
return NULL;
}
/************************************************
* *
************************************************/
int
set_domain_name (char *name)
{
_ti_func func = search_ti_entry ();
if (func)
return func (_TI_set_domain_name, (long *)name);
return -1;
}
/************************************************
* *
************************************************/
char *
get_domain_name (void)
{
_ti_func func = search_ti_entry ();
if (func)
return (char *)func (_TI_get_domain_name, NULL);
return NULL;
}
/************************************************
* *
************************************************/
int
res_query (char *dname, int class, int type, unsigned char *answer, int anslen)
{
long args[5];
_ti_func func = search_ti_entry ();
args[0] = (long)dname;
args[1] = (long)class;
args[2] = (long)type;
args[3] = (long)answer;
args[4] = (long)anslen;
if (func)
return func (_TI_res_query, args);
return -1;
}
/************************************************
* *
************************************************/
int
res_search (char *dname, int class, int type, unsigned char *answer, int anslen)
{
long args[5];
_ti_func func = search_ti_entry ();
args[0] = (long)dname;
args[1] = (long)class;
args[2] = (long)type;
args[3] = (long)answer;
args[4] = (long)anslen;
if (func)
return func (_TI_res_search, args);
return -1;
}
/************************************************
* *
************************************************/
int
res_mkquery (int op, char *dname, int class, int type, char *data, int datalen,
struct rrec *newrr, char *buf, int buflen)
{
long arg[9];
_ti_func func = search_ti_entry ();
arg[0] = (long)op;
arg[1] = (long)dname;
arg[2] = (long)class;
arg[3] = (long)type;
arg[4] = (long)data;
arg[5] = (long)datalen;
arg[6] = (long)newrr;
arg[7] = (long)buf;
arg[8] = (long)buflen;
if (func)
return func (_TI_res_mkquery, arg);
return -1;
}
/************************************************
* *
************************************************/
int
res_send (char *msg, int msglen, char *answer, int anslen)
{
long arg[4];
_ti_func func = search_ti_entry ();
arg[0] = (long)msg;
arg[1] = (long)msglen;
arg[2] = (long)answer;
arg[3] = (long)anslen;
if (func)
return func (_TI_res_sendquery, arg);
return -1;
}